home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / sviluppo / svilupp2 / amphn192.lha / src / ciatimer.h < prev    next >
C/C++ Source or Header  |  1996-11-16  |  3KB  |  64 lines

  1. #ifndef CIATIMER_H
  2. #define CIATIMER_H
  3.  
  4. /* Send this to StartSampling() if you just want to check the timer status */
  5. /* or to AllocParallel(), to see if parallel is available */
  6. #define CHECK_STATUS    2
  7.  
  8. /* timeslice is 46911 intervals.  Each interval is 1.397 microseconds,
  9.  * this should correspond to a timing interval of 65536 microseconds */
  10. #define CIA_TIME_SLICE ((unsigned short) 46911)
  11. #define CIATIMER_INTERRUPT_NAME "AmiPhone Sampling Timer"
  12. #define SILENCE (UsesInvertedSamples() ? -1L : 0L)
  13.  
  14.  
  15. struct IntInfo {
  16.     UBYTE        * pubIndex;        /* 0 - pointer to next open spot */
  17.     UBYTE         * pubArray;        /* 4 - pointer to beginning of array */
  18.     UBYTE        * pubSampleAt;    /* 8 - byte address to sample at */
  19.     UBYTE        * pubHalfIndex;    /* 12 - pointer to halfway point */
  20.     UBYTE        * pubEndIndex;    /* 16 - pointer to end of array */
  21.     struct Task * stTask;        /* 20 - pointer to task to signal when a buffer is ready */
  22.     ULONG          ulHalfSignal;    /* 24 - signal mask for left buffer */
  23.     ULONG          ulFullSignal;    /* 28 - signal mask for right buffer */
  24.     ULONG           ulShiftLeft;    /* 32 - number of positions to shift each sample left by */
  25.     ULONG          ulByteSum;    /* 36 - Current sum of all bytes */
  26.     ULONG          ulSaveByteSum;    /* 40 - Sum of all bytes in last packet */
  27.     ULONG          ulThreshhold;    /* 44 - minimum value to raise sampling rate */
  28.     UBYTE       * pubCiahi;            /* 52 - address of high CIA countdown byte */
  29.     UBYTE       * pubCialo;        /* 56 - address of low CIA countdown byte */
  30.     ULONG          uwCiavals;     /* 60 - values to put in hi & low cia bytes */
  31.     ULONG          uwClearCode;    /* 64 - Value to put in intreq(A0) to signal interrupt handled */
  32.     ULONG          BIdle;        /* 68 - Boolean showing whether or not we are currently idle */
  33.     ULONG          ulDebug1;        /* 72 - debug output field 1 */
  34.     ULONG          ulDebug2;        /* 76 - debug output field 2 */
  35. };
  36.  
  37.  
  38. /* Function prototypes */
  39. BOOL AllocParallel(BOOL BAlloc, BOOL BGrab);
  40. BOOL StartSampling(BOOL BStart, ULONG ulBytesPerSec);
  41. BOOL AllocSignals (BOOL BAlloc);
  42. ULONG ChangeSampleSpeed(ULONG ulNewBPS, UBYTE bComp);
  43. BOOL TellOtherAmiPhoneToLetGo(char * szOtherPhoneName);
  44. BOOL SetupPreSendQueue(BOOL BSetup);
  45.  
  46. ULONG ProcessToccataBuffer(UBYTE * pubData, ULONG ulDataLen);
  47. ULONG ProcessAHIBuffer(UBYTE * pubData, ULONG * ulDataLen, ULONG ulType);
  48.  
  49. void TransmitData(UBYTE * pubStart, int ulLength, int bTransmitMode);
  50. void ChangeInputChannel(int nNewChannel);
  51. void ChangeSamplerType(int nNewSamplerType);
  52. void ChangeInputSource(int nNewSource, BOOL BMakePermanent);
  53. void ChangeCompressMode(UBYTE ubNewMode);
  54. void SetToccataInputSpecs(void);
  55. void ResetDigitizer(BOOL BReset);
  56.  
  57. void RaiseLineGain(int nSteps);
  58. void SetMicGain(int nNewValue);
  59.  
  60. int CalcVolumePercentage(ULONG ulVolume);
  61.  
  62.  
  63. #endif
  64.